/*    */ package com.feeyin.radar.sys.controller;
/*    */ 
/*    */ import com.feeyin.radar.sys.form.CommonSettingsForm;
/*    */ import com.feeyin.radar.sys.service.CommonSettingsService;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import org.springframework.web.servlet.ModelAndView;
/*    */ import org.springframework.web.servlet.mvc.multiaction.MultiActionController;
/*    */ import org.springframework.web.servlet.view.RedirectView;
/*    */ 
/*    */ public class CommonSettingsController extends MultiActionController
/*    */ {
/*    */   private CommonSettingsService commonSettingsService;
/*    */   private String commonSet;
/*    */ 
/*    */   public CommonSettingsService getCommonSettingsService()
/*    */   {
/* 30 */     return this.commonSettingsService;
/*    */   }
/*    */ 
/*    */   public void setCommonSettingsService(CommonSettingsService commonSettingsService) {
/* 34 */     this.commonSettingsService = commonSettingsService;
/*    */   }
/*    */ 
/*    */   public String getCommonSet()
/*    */   {
/* 46 */     return this.commonSet;
/*    */   }
/*    */ 
/*    */   public void setCommonSet(String commonSet) {
/* 50 */     this.commonSet = commonSet;
/*    */   }
/*    */ 
/*    */   public ModelAndView display(HttpServletRequest request, HttpServletResponse response)
/*    */   {
/* 55 */     Map map = new HashMap();
/* 56 */     map.put("result", request.getParameter("result"));
/* 57 */     map.put("commonSettings", this.commonSettingsService.getCommonSettings());
/* 58 */     return new ModelAndView(getCommonSet(), map);
/*    */   }
/*    */ 
/*    */   public ModelAndView updateCommonSettings(HttpServletRequest request, HttpServletResponse response, CommonSettingsForm commonSettingsForm)
/*    */   {
/* 63 */     boolean result = false;
/* 64 */     int success = 0;
/* 65 */     if (commonSettingsForm != null) {
/* 66 */       result = this.commonSettingsService.updateCommonSettings(commonSettingsForm);
/* 67 */       if (result) {
/* 68 */         success = 1;
/* 69 */         CommonSettingsForm commonForm = new CommonSettingsForm();
/* 70 */         commonForm = this.commonSettingsService.getCommonSettings();
/* 71 */         if ((commonForm != null) && ("0".equals(commonForm.getIsUseCommon()))) {
/* 72 */           success = 2;
/*    */         }
/*    */       }
/*    */     }
/* 76 */     return new ModelAndView(new RedirectView("./commonSettings.do?action=display&result=" + success));
/*    */   }
/*    */ 
/*    */   public ModelAndView moveToExceptionCustomer(HttpServletRequest request, HttpServletResponse response)
/*    */   {
/* 81 */     boolean result = false;
/* 82 */     int success = 0;
/* 83 */     result = this.commonSettingsService.moveToExceptionCustomer();
/* 84 */     if (result) success = 3;
/* 85 */     return new ModelAndView(new RedirectView("./commonSettings.do?action=display&result=" + success));
/*    */   }
/*    */ }

/* Location:           C:\Users\e547415\MyProject\rone\WEB-INF\classes\
 * Qualified Name:     com.feeyin.radar.sys.controller.CommonSettingsController
 * JD-Core Version:    0.6.0
 */